package cn.richard.base

import androidx.multidex.MultiDexApplication
import cn.richard.base.starter.InitHomeModuleTask
import cn.richard.base.starter.InitKoinTask
import cn.richard.base.starter.InitRouterTask
import cn.richard.base.util.RouterHelper
import com.alibaba.android.arouter.launcher.ARouter
import com.wxy.appstartfaster.dispatcher.AppStartTaskDispatcher
import org.koin.android.ext.koin.androidContext
import org.koin.android.ext.koin.androidLogger
import org.koin.core.context.startKoin
import kotlin.properties.Delegates

/**
 *
 * @ProjectName: PicApp
 * @Author: wuzhiguo@aiforward.com
 * @CreateDate: 2021/9/1 5:18 下午
 * @Description:
 */

class App: MultiDexApplication() {

    companion object {
        var instance: App by Delegates.notNull()
    }

    override fun onCreate() {
        super.onCreate()
        instance = this


        AppStartTaskDispatcher.getInstance()
            .setContext(this)
            .addAppStartTask(InitKoinTask())
            .addAppStartTask(InitRouterTask())
            .addAppStartTask(InitHomeModuleTask())
            .start()
            .await()
    }

}